﻿using System.Data.Entity.ModelConfiguration;

namespace Delphi.Mimir.Data.Entities.Raw.Mappings {
    public class RawSymbolChangeMap : EntityTypeConfiguration<RawSymbolChange> {
        public RawSymbolChangeMap() {
            /******************************************************************
            /* Table
            /*****************************************************************/
            ToTable("raw.eod_symbol_changes");

            /******************************************************************
            /* Primary Key
            /*****************************************************************/
            HasKey(a => a.syc_id);

            /******************************************************************
            /* Index
            /*****************************************************************/
            // None

            /******************************************************************
            /* Relationships
            /*****************************************************************/
            // None

            /******************************************************************
            /* Properties
            /*****************************************************************/
            Property(a => a.syc_id)
                .IsRequired()
                .HasColumnName("syc_id");

            Property(a => a.syc_exc_cd_old)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("syc_exc_cd_old");

            Property(a => a.syc_sym_cd_old)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("syc_sym_cd_old");

            Property(a => a.syc_exc_cd_new)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("syc_exc_cd_new");

            Property(a => a.syc_sym_cd_new)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("syc_sym_cd_new");

            Property(a => a.syc_change_dt)
                .IsRequired()
                .HasColumnName("syc_change_dt");
        }
    }
}
